package pers.dnf.test.java.springcloud.client.config.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.dnf.test.java.springcloud.client.config.beans.config.FromConfig;

/**
 * @author dengfan
 * @version 1.0
 * @description
 * @date 2018/9/12 0012 16:49
 */
@RestController
@RefreshScope
public class ConfigClientAPI {

    @Autowired
    private FromConfig fromConfig;

    @RequestMapping(value="/from")
    public String from(){
        return fromConfig.getProfile();
    }
}
